#include "widget.h"
#include "ui_widget.h"
#include <QIcon>
#include <QSize>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QIcon icon(":/LInux.jpg");
    ui->pushButton->setIcon(icon);
    //
    QSize q(100,100);
    ui->pushButton->setIconSize(q);

    //设置快捷键
    //方法一：直接写出按键的名称，容易出错
    ui->pushButton->setShortcut(QKeySequence("w"));
    //方法二：使用Qt内置的快捷键枚举
    ui->pushButton->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));

    //设置鼠标连击
    ui->pushButton->setAutoRepeat(true);
}

Widget::~Widget()
{
    delete ui;
}

